package com.idanchuang.component.provider.config;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yjy
 * @date 2019/11/21 9:04
 **/
public class InterceptorConfig {

    /** 是否启用RPC拦截 */
    private boolean enabled;
    private List<String> includes;
    private List<String> excludes;

    {
        enabled = true;
        // 初始化默认拦截配置
        includes = new ArrayList<>();
        includes.add("/*");
        includes.add("/**/*");
        excludes = new ArrayList<>();
        excludes.add("/common/**");
        excludes.add("/static/**");
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public List<String> getIncludes() {
        return includes;
    }

    public void setIncludes(List<String> includes) {
        this.includes = includes;
    }

    public List<String> getExcludes() {
        return excludes;
    }

    public void setExcludes(List<String> excludes) {
        this.excludes = excludes;
    }

    @Override
    public String toString() {
        return "InterceptorConfig{" +
                "enabled=" + enabled +
                ", includes=" + includes +
                ", excludes=" + excludes +
                '}';
    }
}
